/**
*      author: Y_Yao
*      created: 2025-01-18 11:26:00
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;
const int N = 2e5 + 6;
int n,m;
struct node
{
    int x,y;
    char c;
};

node a[N];

bool check()
{
    int maxblack = n + 1;
    for(int i = 1;i <= m;i++)
    {
        if(a[i].c == 'W')
        {
            maxblack = min(maxblack,a[i].y - 1);
            continue;
        }
        if(a[i].y > maxblack)
        {
            return false;
        }
    }
    return true;
}

bool operator<(const node& t1,const node& t2)
{
    if(t1.x == t2.x)
    {
        return t1.y < t2.y;
    }
    return t1.x < t2.x;
}

void solve()
{
    cin >> n >> m;
    for(int i = 1;i <= m;i++)
    {
        cin >> a[i].x >> a[i].y >> a[i].c;
    }

    sort(a + 1, a + 1 + m);

    if(check())
    {
        cout << "Yes" << endl;
        return;
    }
    cout << "No" << endl;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}
